﻿using GENERIC.Repository.Tests.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;

namespace GENERIC.EFRepository.Tests
{
    public class OrderMapping : EFMapping<Order>
    {
        #region Constructeur

        public OrderMapping()
        {
        }

        #endregion

        #region Properties

        protected override string TableName
        {
            get { return "Orders"; }
        }

        #endregion
        
        #region Methods

        protected override Expression<Func<Order, object>> GetPrimaryKey()
        {
            return i => i.Id ;
        }

        protected override void MapProperties()
        {
            Property(i => i.Price).HasColumnName("price").IsRequired();
            Property(i => i.CustumerId).HasColumnName("customerId").IsRequired();
        }

        #endregion
    }
}
